%table.table.table-striped.invoices.collection
  %thead
    %tr
      %th= t_attr :value_date, Invoice
      %th= t_attr :code, Invoice
      %th= t_attr :title, Invoice
      %th= t_attr :company, Invoice
      %th= t_attr :due_date, Invoice
      %th.currency= t_attr :amount, Invoice
      %th.currency= t_attr :balance, Invoice
      %th.action-links
  %tbody
    = render @credit_invoices
  %tfoot
    %tr#invoices_list_footer
      %th{:style => "width: 10em"}= l Date.today
      %th{:colspan => 4}= t('bookyt.total')
      %th.currency= currency_fmt(@credit_invoices.to_a.sum(&:amount))
      %th.currency= currency_fmt(@credit_invoices.to_a.sum(&:balance))
      %th
